﻿using System;
using System.IO;

namespace Ahresty
{
    internal class Logger
    {
        internal static string FilePath { get; set; }


        internal static void Write(string content)
        {
            string timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

            Console.WriteLine(String.Format("{0} : {1}", timeStamp, content));
            File.AppendAllText(Logger.FilePath, String.Format("{0} : {1}\r\n", timeStamp, content));
        }

        internal static void Write(string content, bool hasTimeStamp)
        {
            if (hasTimeStamp)
            {
                string timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

                Console.WriteLine(String.Format("{0} : {1}", timeStamp, content));
                File.AppendAllText(Logger.FilePath, String.Format("{0} : {1}\r\n", timeStamp, content));
            }
            else
            {
                Console.WriteLine(content);
                File.AppendAllText(Logger.FilePath, String.Format("{0}\r\n", content));
            }
        }
    }
}
